<template>
    <Table :columns="columns" :data="value">
        <template slot-scope="{row, index}" slot="product_sku">
            {{row.product.sku}}
        </template>
        <template slot-scope="{row, index}" slot="product_name">
            {{row.product.name}}
        </template>
        <template slot-scope="{row, index}" slot="quantity">
            {{row.quantity.toLocaleString()}}
        </template>
        <template slot-scope="{row, index}" slot="price">
            {{row.price.toLocaleString()}}
        </template>
    </Table>
</template>

<script>
    export default {
        name: "IProduct",
        components: {},
        props: {
            value: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                columns: [{
                    title: '序号',
                    width: 80,
                    type: 'index'
                }, {
                    title: '产品SKU',
                    slot: 'product_sku'
                }, {
                    title: '产品名称',
                    slot: 'product_name'
                }, {
                    title: '产品数量',
                    slot: 'quantity'
                }, {
                    title: '产品单价',
                    slot: 'price'
                }, {
                    title: '失效时间',
                    key: 'lot'
                }, {
                    title: '操作时间',
                    key: 'created_at'
                }]
            }
        }
    }
</script>

<style scoped>

</style>
